package com.zhangshuo.patternDesign.memento;

/**
 * Created by shuo.zhang on 2017-10-27.
 *
 *
 * 管理者，用来管理备忘录
 *
 *
 */
public class Manager {

    private Memento memento;

    /**
     * 抽离记忆
     * @param person
     */
    public void pullMemory(Person person){
        this.memento = person.getMemento();
    }

    /**
     * 强制回退记忆
     * @param person
     */
    public void forcedPutMemory(Person person){
        person.setMemento(this.memento);

    }


}
